package com.j283_5.wisdom_park.controller.confcenter_management.roleinfo;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.j283_5.wisdom_park.common.result.ResultData;
import com.j283_5.wisdom_park.pojo.Project;
import com.j283_5.wisdom_park.pojo.Roleinfo;
import com.j283_5.wisdom_park.pojo.Resinfomanage;
import com.j283_5.wisdom_park.pojo.Roleinfo;
import com.j283_5.wisdom_park.service.RoleinfoService;
import com.j283_5.wisdom_park.vo.confcenter_management.ProjectVo;
import com.j283_5.wisdom_park.vo.confcenter_management.RoleinfoVo;
import com.j283_5.wisdom_park.vo.visitor_management.AddVisitorsVo;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiImplicitParams;
import io.swagger.annotations.ApiOperation;
import jdk.nashorn.internal.ir.annotations.Ignore;
import org.apache.ibatis.annotations.Param;
import org.springframework.web.bind.annotation.*;
import springfox.documentation.annotations.ApiIgnore;

import javax.annotation.Resource;
import javax.servlet.http.HttpServletRequest;
import java.sql.Timestamp;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

@RestController
@RequestMapping("/roleinfo")
@Api(value = "角色管理",tags = "角色管理",produces = "罗移筵")
public class RoleinfoController {
    @Resource
    private RoleinfoService roleinfoService;

    @PostMapping("/roleInfoByName")
    @ApiOperation(value = "根据角色名查询角色信息",notes = "根据角色名查询角色信息",produces = "罗移筵",response = ResultData.class)
    public ResultData getRolePage(@Param("page") Page<Roleinfo> page, String roName , HttpServletRequest request){

        return roleinfoService.getRolePage(page,roName);
    }

    /**
     * 添加角色信息
     * @param roleinfoVo
     * @return
     */
    @RequestMapping(value = "/addRoleInfo",method = RequestMethod.POST)
    @ApiOperation(value = "添加角色信息",notes = "添加角色信息",produces = "罗移筵",response = ResultData.class)
    public ResultData addRoleInfo(@RequestBody RoleinfoVo roleinfoVo){
       return roleinfoService.addRoleInfo(roleinfoVo);
    }

    /**
     * 删除角色信息
     * @param roIdlist
     * @return
     */
    @RequestMapping(value = "/deleteRoleInfo",method = RequestMethod.POST)
    @ApiOperation(value = "删除角色信息",notes = "删除角色信息",produces = "罗移筵",response = ResultData.class)
    public ResultData deleteRoleInfo(@RequestBody ArrayList<Integer> roIdlist){
        return roleinfoService.deleteRoleInfo(roIdlist);
    }

    /**
     * 修改角色信息
     * @param roleinfo
     * @return
     */

    @RequestMapping(value = "/updateRoleInfo",method = RequestMethod.POST)
    @ApiOperation(value = "修改角色信息",notes = "修改角色信息",produces = "罗移筵",response = ResultData.class)
    public ResultData updateRoleInfo(@RequestBody Roleinfo roleinfo){
        return roleinfoService.updateRoleInfo(roleinfo);
    }

}
